//
//  PSNodeScoreTests.m
//  PrefCore
//
//  Created by Sergey on 5/15/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import <XCTest/XCTest.h>
#import "PSNodeScore.h"

@interface PSNodeScoreTests : XCTestCase

@end

@implementation PSNodeScoreTests

- (void)testScoreGet {
    XCTAssertEqual(1, PSScoreGet(0x0123, 2));
    XCTAssertEqual(2, PSScoreGet(0x0123, 1));
    XCTAssertEqual(3, PSScoreGet(0x0123, 0));
}

- (void)testScoreIncrement {
    XCTAssertEqual(0x223, PSScoreIncrement(0x0123, 2));
    XCTAssertEqual(0x133, PSScoreIncrement(0x0123, 1));
    XCTAssertEqual(0x124, PSScoreIncrement(0x0123, 0));
}

- (void)testScoreDescription {
    XCTAssertEqualObjects(@"---", PSScoreDescription(0));
    XCTAssertEqualObjects(@"321", PSScoreDescription(0x123));
    XCTAssertEqualObjects(@"EDF", PSScoreDescription(0xFDE));
    XCTAssertEqualObjects(@"321'", PSScoreDescription(0x1123));
    XCTAssertEqualObjects(@"EDF'", PSScoreDescription(0x1FDE));
}

@end
